/**
 * 
 */
package it.irondev.appturismo.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import it.irondev.appturismo.dao.GalleryMapper;
import it.irondev.appturismo.dao.MediaMapper;
import it.irondev.appturismo.entity.Gallery;
import it.irondev.appturismo.entity.Media;
import it.irondev.appturismo.service.IGalleryService;

/**
 * @author federico
 *
 */
@Service
public class GalleryServiceImpl implements IGalleryService {

	@Autowired
	GalleryMapper galleryDao;
	
	@Autowired
	MediaMapper mediaDao;
	
	public Gallery getGalleryById(Integer idGallery) {
		return galleryDao.selectByPrimaryKey(idGallery);
	}

	public List<Gallery> getAllGallerys() {
		return null;
	}

	public int addGallery(Gallery gallery) {
		return galleryDao.insert(gallery);
	}

	public void updateGallery(Gallery gallery) {
		galleryDao.updateByPrimaryKey(gallery);
	}

	public void deleteGallery(Integer idGallery) {
		// TODO Auto-generated method stub
		
	}

	public void addMedia(Media media) {
		mediaDao.insert(media);
	}

	public void deleteMedia(Integer idMedia) {
		mediaDao.deleteByPrimaryKey(idMedia);
	}
	
	
	

}
